package com.lianzhihui.romeex.mvp.presenter;

import android.content.Context;

import com.lianzhihui.romeex.mvp.model.PledgeInterface;
import com.lianzhihui.romeex.mvp.model.PledgeModelImp;
import com.lianzhihui.romeex.mvp.view.PledgeView;

/**
 * Description:
 * Author: RAMON
 * CreateDate: 11/30/20 2:31 PM
 * UpdateUser:
 * UpdateDate:
 * UpdateRemark:
 * Version:
 */
public class PledgePresenter implements PledgeInterface {

    Context context;
    PledgeView iView;
    PledgeModelImp iModel;

    public PledgePresenter(Context context, PledgeView iView) {
        this.context = context;
        this.iView = iView;
        iModel = new PledgeModelImp(context, this);
    }

    public void pledge(String value) {
        iModel.pledge(value);
    }

    public void extract() {
        iModel.extract();
    }

    @Override
    public void onPledgeSuccess() {
        iView.onPledgeSuccess();
    }

    @Override
    public void onPledgeFail(String message) {
        iView.onPledgeFail(message);
    }

    @Override
    public void onExtractSuccess() {
        iView.onExtractSuccess();
    }

    @Override
    public void onExtractFail(String message) {
        iView.onExtractFail(message);
    }
}
